<template>
	<view class="">
		<view class="choice spaceBetween" @click="open">
			<view class="title">选择规格</view>
			<view class="str flex">
				<view class="txt">
					{{ str }}
				</view>
				<image class="icon" src="/static/images/go.png" mode=""></image>
			</view>
		</view>
		<bulletBox ref="bulletBox" :indexList="indexList" :data="data" @editPrice="editPrice"></bulletBox>
	</view>
</template>

<script>
	import bulletBox from './bulletBox.vue';
	export default {
		name: 'choice',
		components: {
			bulletBox,
		},
		props: {
			data: {
				type: Object,
				default: () => {},
			},
		},

		data() {
			return {
				str: '请选择规格',
				indexList: {},
			};
		},
		methods: {
			open() {
				this.$refs.bulletBox.open();
			},
			editPrice(data) {
				console.log(data.str)
				this.str = data.str;
				this.$emit('editPrice', data);
			},
		},
	};
</script>

<style lang="scss" scoped>
	.choice {
		overflow: hidden;
		width: 100%;
		height: 90rpx;
		background: #ffffff;
		align-items: center;
		margin-top: $margin-width;
		font-size: $uni-font-size-12;
		.title {
			color: #000000;
			margin-left: $margin-width;
		}
		.str {
			align-items: center;
			margin-right: $margin-width;
			.txt {
				color: #999999;
				margin-right: $submargin-width;
			}
			.icon {
				width: 11rpx;
				height: 20rpx;
			}
		}
	}
</style>
